/*
 * Thread.cpp
 *
 *  Created on: 11.12.2012
 *      Author: zheka
 */

#include "Thread.hpp"
#include "util/ProxyException.hpp"
void * Thread::threadFunc(void * args) {
	((Thread *) args)->run();
	return NULL;
}
void Thread::start() {

	if (pthread_create(&thread, NULL, Thread::threadFunc, (void*) this) != 0) {
		throw ProxyException("[Thread] Can't create thread!");
	}
}
void Thread::wait() {
	pthread_join(thread, NULL);
}
